﻿using System;
using MongoDB.Driver;

namespace NetCoreMongodb
{
    class Program
    {
        private static  IMongoDatabase _database = null;
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var data=new MongoDBBase("mongodb://sa:bnq2018@192.168.189.171:27017", "DsbuyerShop");
            var list=data.GetList<Edb_Class>();
            Console.WriteLine($"_id\t\t\tclass_code\tclass_name\tparent_class_code\tis_pack\tpacking_charges\trough_weight_ratio\tis_suit\tsort_type\tPullTime\tPushState\tPushFailMsg");
            list.ForEach(x =>
            {
                Console.WriteLine($"{x._id}\t{x.class_code}\t{x.class_name}\t{x.parent_class_code}\t{x.is_pack}\t{x.packing_charges}\t{x.rough_weight_ratio}\t{x.is_suit}\t{x.sort_type}\t{x.PullTime}\t{x.PushState}\t{x.PushFailMsg}");
            });
            Console.WriteLine();
            Console.ReadLine();
        }

    }
}
